<template>
    <div class="home-banner">
        <el-carousel :autoplay="true"  height="500px" :interval="5000">
            <el-carousel-item v-for="item in sliders" :key="item.id">
                <img :src="item.imgUrl">
            </el-carousel-item>
        </el-carousel>
    </div>
</template>

<script>
    import {findBanner} from "@/api/home";

    export default {
        name: "HomeBanner",
        data() {
            return {
                sliders: []
            }
        },
        created() {
            this.findBanner()

        },
        methods: {
            async findBanner() {
                const {result} = await findBanner()
                this.sliders = result
            }
        }
    }
</script>

<style  lang="less">

    .home-banner {
        width: 1240px;
        height: 500px;
        position: absolute;
        left: 0;
        top: 0;
        z-index: 98;
        color: red;
    }
    .el-carousel__arrow--left{
        left: 270px;
    }
    .el-carousel__button{
        width: 10px;
        height: 10px;
        border-radius: 5px;
    }

</style>